package com.example.eurekaadmin.controller;

import com.example.eurekacommon.AjaxResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @version 1.0.0
 * @className: TestController
 * @description:
 * @author: zhangjunfa
 * @date: 2022/6/16 9:40
 */
@RestController
@RequestMapping
@RefreshScope
public class TestController {

    @GetMapping("/testAdmin")
    public String test() {
        return "我是Eureka服务的消费者，我的名字是eureka-admin";
    }


    @Value("${version}")
    private String value;

    @GetMapping("/test")
    public String getEv() {
        return value;
    }

    @GetMapping("/test2")
    public AjaxResult test2() {
        List<String> list=new ArrayList<>();
        list.add("ross");
        list.add("zhang");
        list.add("ross zhang");
        list.add("zhang ross");
        list.add("ross1");
        list.add("ross2");
        System.out.println("dldsjfksdlfslkdfjl:"+list.size());
        return AjaxResult.success(list);
    }
}
